UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AoSctz/sgOr6IBXrWRJfQJfgKB5vEeWA/SbDkJ+8ggY=' 
WHERE 
  key_id = 'cc01271d12f0892c3e62139f37da0fa1f9da50b6ae86565f6c0ffc66bde33f18' 
  AND (
    token = 'AoSctz/sgOr6IBXrWRJfQJfgKB5vEeWA/SbDkJ+8ggY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015