UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zraSnX6mGixoT8ouGpziW2QM4K1OWbCMcuBbvjM2eh0=' 
WHERE 
  key_id = '7192252865dd57450e56aa09366e16f4fc87afd96cd6c0ee032b8333ca091d7b' 
  AND (
    token = 'zraSnX6mGixoT8ouGpziW2QM4K1OWbCMcuBbvjM2eh0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029