UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9nJ3H1AiIGImR/W03GXIygIN+JSp+osPdljFQSm3tgM='
WHERE
key_id = '771df886d14f5c0244b5ab0f4972c340a6f873985eaf9cc9bdfcb19da190b062'
AND (
token = '9nJ3H1AiIGImR/W03GXIygIN+JSp+osPdljFQSm3tgM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)