UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lABFek74jtZ/l9r2dsU4Q7k0eV4ngz2isp2Vcl6FcEk='
WHERE
key_id = 'c60c8a3576fb4cc52cfa8202c8a685f50cda63111cb57bb2eff1e2df32857c1c'
AND (
token = 'lABFek74jtZ/l9r2dsU4Q7k0eV4ngz2isp2Vcl6FcEk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)