UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vWEj1bSxVVKZbkVx3Jh26SwSfjgDpVaxXz2SsihSEBg=' 
WHERE 
  key_id = '130154fb3ba88d8dce18da7d8f6055ca264fc6a662a597b37775981b6217624c' 
  AND (
    token = 'vWEj1bSxVVKZbkVx3Jh26SwSfjgDpVaxXz2SsihSEBg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052