UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WuymC+CbEPMbLLRBx92wXFG/ycr+Akmet5RiHZ8RCG0='
WHERE
key_id = '04eb25fc65ddc4003c06b25cb83caee9a275302aba3077f7d10a9a983b2fdac4'
AND (
token = 'WuymC+CbEPMbLLRBx92wXFG/ycr+Akmet5RiHZ8RCG0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)