UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jSnQLzuPSdlH7vOjFgdPD4kUPspBj2Y05YxkOgx6Y9A=' 
WHERE 
  key_id = 'b2f4543f2fd94754057acecaa8e9f954294591b52e37cc201219739b74a8e5fb' 
  AND (
    token = 'jSnQLzuPSdlH7vOjFgdPD4kUPspBj2Y05YxkOgx6Y9A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024