UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YbX0hDSvddovsyS2XFivxohGtE3NxXZFeyiydLiTHXw=' 
WHERE 
  key_id = '6f99ed56e5d945dda7de02692dbd4e3fdf53b89ce7c9d1b79984d579c57fd403' 
  AND (
    token = 'YbX0hDSvddovsyS2XFivxohGtE3NxXZFeyiydLiTHXw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00058