UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4re2mRL0Qnk3GYnfRpws6M8HPFg0VWusG/gLwihyxRs='
WHERE
key_id = 'fd93729d5edd3be9070d8ed5ce38969d1f913264f52793928d3a043d4ad0b0ca'
AND (
token = '4re2mRL0Qnk3GYnfRpws6M8HPFg0VWusG/gLwihyxRs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)