UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QSKA/ZOf2FelIfLY9CFe4bJIKyzZeYdfJncXyLRblck=' 
WHERE 
  key_id = '26f75c5cbd35e050864400607842f3c041293f91febfb7ea3a07a5d9095537a5' 
  AND (
    token = 'QSKA/ZOf2FelIfLY9CFe4bJIKyzZeYdfJncXyLRblck=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00068