UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '896rVqsTyHHKg/i24GwioXmAMalgAJI9N/reeAPizk0='
WHERE
key_id = 'f25f916baf9c0871ecbd03d5ea45d2b455ca981e0dcb7f02f7d3d74aa1c7f6dc'
AND (
token = '896rVqsTyHHKg/i24GwioXmAMalgAJI9N/reeAPizk0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)