UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ywTds+s8XgzPm2fU9z6zkrtu2E3Eg5ljWDhMf/jnoig='
WHERE
key_id = '3e14f940a9b13052e501d19af69e80b9202591855044c26e9bd9f758caf87bcb'
AND (
token = 'ywTds+s8XgzPm2fU9z6zkrtu2E3Eg5ljWDhMf/jnoig='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)