UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pkmzCiA86/fQ9rqlptFPLyGJs9QHDQL373LTdRpG0MY=' 
WHERE 
  key_id = '3a9a2a1894fcb9fe29a88bcf01f6cd19e1b36bd8bb33111566413cfe29914cf0' 
  AND (
    token = 'pkmzCiA86/fQ9rqlptFPLyGJs9QHDQL373LTdRpG0MY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042