UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lwUBhgb7TYyVztINOX96bhv8OlL80lOOUFOlAs53KDo=' 
WHERE 
  key_id = '7eed62266cbf8df69519084114d65bdb1b9565711e0f0c87bf14cdde6ad0048c' 
  AND (
    token = 'lwUBhgb7TYyVztINOX96bhv8OlL80lOOUFOlAs53KDo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027