UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YCC2YouoVaRePKBEx2xSQ4m+DFxj7JxAnrpwJYryR8o='
WHERE
key_id = 'f78002dd6056ce6a30c906d9593371d6d476a82c99a6ea131875f427575fe12a'
AND (
token = 'YCC2YouoVaRePKBEx2xSQ4m+DFxj7JxAnrpwJYryR8o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)