UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+LrQFD2Sj691tCJAU1sJAr+wCxVJgEXA7/SOulVnrPE='
WHERE
key_id = 'a4d9df7f59e5a50e3424b58920b4b46a950d5defc693adf136b984581746ff21'
AND (
token = '+LrQFD2Sj691tCJAU1sJAr+wCxVJgEXA7/SOulVnrPE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)