UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QRkcFJC/Cl1bmRAnWaOphosx0jt6I4a61QapEUd53/E=' 
WHERE 
  key_id = 'c8533d5d73e9447b4fef9e10406a028c599d3733653b5063c4503358a2aec154' 
  AND (
    token = 'QRkcFJC/Cl1bmRAnWaOphosx0jt6I4a61QapEUd53/E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047