UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dlacO+Vg/HCWpMD2yjGA03hnkUhoiiX13djv/g6VfHg='
WHERE
key_id = 'c46652c7650d96ad04a61469dc1fdcb300958979c605a650ca2cbc4e99ad5a4c'
AND (
token = 'dlacO+Vg/HCWpMD2yjGA03hnkUhoiiX13djv/g6VfHg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)