UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4MuaabasI+cYWEiPub8ISQ441dMKP11l/iIOXVPLZPw='
WHERE
key_id = '7b15c65e439359283f1db5f4072b153d8cb7e25681b2138ebf91af02065a5551'
AND (
token = '4MuaabasI+cYWEiPub8ISQ441dMKP11l/iIOXVPLZPw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)