UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KAXJVe0Esi/ViFV/XUaELV0dRMvyj8lVxRYfuJgDiOQ=' 
WHERE 
  key_id = '7941d6528a77d93a63e037bd938b860518b63eebef6fe59d7e746547e303c50d' 
  AND (
    token = 'KAXJVe0Esi/ViFV/XUaELV0dRMvyj8lVxRYfuJgDiOQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022