UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'w8+VwNtitY1s3dVSSblNBnWep+yj0UKpyIGU2G9IOL0='
WHERE
key_id = '75dc284a4bf651348cf60a3de0ddc106a508530628d2c3f6c6a11964ab32c7de'
AND (
token = 'w8+VwNtitY1s3dVSSblNBnWep+yj0UKpyIGU2G9IOL0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)