UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1hGrUzOBSCEb8+SyPJV+IFwIs2o00ivFUe9929tY6GA='
WHERE
key_id = '90af7150dec6a3c1624d1e26da266dbddea3cafa34f1154793195073a963acc3'
AND (
token = '1hGrUzOBSCEb8+SyPJV+IFwIs2o00ivFUe9929tY6GA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)