UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wIraglokNM4G26e78ihgKYdljTJzvKRrekPXsZWTPv8='
WHERE
key_id = '5d0ac1bd9adb674f8c8d75bf817164cccb0917cbfca027429df1310bdacc7a39'
AND (
token = 'wIraglokNM4G26e78ihgKYdljTJzvKRrekPXsZWTPv8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)