UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Y6oM2nOawasSTLnSRQiiSrvkPW6nwUoTT2TP/AJn2V4='
WHERE
key_id = 'ae9701f7b1364b4700a953ba782c56c46b6824901cbd64801605f115ae28490e'
AND (
token = 'Y6oM2nOawasSTLnSRQiiSrvkPW6nwUoTT2TP/AJn2V4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)