UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IJcDwDlrRvUukmNH8wXiFcvr3ZMsEnORCAbnosG1T+s='
WHERE
key_id = '342a84a38aedaf1436b2d513ed89bd646d6f7af8a3a17f5b566f916f5faac2cf'
AND (
token = 'IJcDwDlrRvUukmNH8wXiFcvr3ZMsEnORCAbnosG1T+s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)