UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uZCthA/T3/Bm8uNdQpEeVex56Dp38hYIoCgQlqcrpQY=' 
WHERE 
  key_id = 'd8ad133f8d26370697e6afbc175b8a50fe286de9244d1dc59fda1a18cfd4c615' 
  AND (
    token = 'uZCthA/T3/Bm8uNdQpEeVex56Dp38hYIoCgQlqcrpQY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030