UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pEi2iKNoTxMDnHowUgZde/7YkmNC4Cu0JqAU7Me8EvU='
WHERE
key_id = 'c00b18d8daaa6ccfaa65eea86f86fdde1070d94b37ee41eea628beaae07b4377'
AND (
token = 'pEi2iKNoTxMDnHowUgZde/7YkmNC4Cu0JqAU7Me8EvU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)