UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VzJGaZJ6BJqK1WPmhg2q5DksI51uS08pNQIgFdWIBzY=' 
WHERE 
  key_id = '66f63b6aa936fcc28b3d3a165eb908cbab4fc36ed0671474e85bec30515ab0f0' 
  AND (
    token = 'VzJGaZJ6BJqK1WPmhg2q5DksI51uS08pNQIgFdWIBzY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033