UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EL4vP/3AHd6qAo/7HWwM41m9XZYqEGe5AaRfgrJjZ2w=' 
WHERE 
  key_id = '7bfeadd26433671d23dade73c2a9b382f39221580d59eea26f558a6b811952dd' 
  AND (
    token = 'EL4vP/3AHd6qAo/7HWwM41m9XZYqEGe5AaRfgrJjZ2w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048