UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OXZRl5eM472aZLW2DmKiyHB+C7TbhbOkDlm3aic+VM4='
WHERE
key_id = 'e049abc2e0a69cea083502a1d9945c44deb01d2a22dd1ca00da8fe00e50eb2b7'
AND (
token = 'OXZRl5eM472aZLW2DmKiyHB+C7TbhbOkDlm3aic+VM4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)