UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oLxp1JIJbhgy6BQVy/KNMUURSAx3riKCXC/I49eH5u8=' 
WHERE 
  key_id = 'ee1509a45f62f47cf7a7c257acee381c8ef311f540e5245b6efcf69e50791c2c' 
  AND (
    token = 'oLxp1JIJbhgy6BQVy/KNMUURSAx3riKCXC/I49eH5u8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021