UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/Ozt4EhuZ/YvfFDS0Z+ils+WXJTZFOLswW9kNxZccx8=' 
WHERE 
  key_id = '98c0379bda36b15e33f5c2e36f26ab85a2756e49053e64d633998eb8f93bd874' 
  AND (
    token = '/Ozt4EhuZ/YvfFDS0Z+ils+WXJTZFOLswW9kNxZccx8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033