UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zI/m1xgVRtbopmcHz6N6mWl15r85pwaHbrfpDEzVERo='
WHERE
key_id = '80b842205d596699cc6afce05136b9e2acaf6c875c3ea22cd874f2832590f507'
AND (
token = 'zI/m1xgVRtbopmcHz6N6mWl15r85pwaHbrfpDEzVERo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)