UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KMsCueQfjaNRqEpUTPQuWuE3hO1wXUvqfLYnbasdJSM=' 
WHERE 
  key_id = '2930e4857b6cfc81973a60575952935d2bb6fa7107a7e296d0a57fc2792c384d' 
  AND (
    token = 'KMsCueQfjaNRqEpUTPQuWuE3hO1wXUvqfLYnbasdJSM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030