UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EITZ2rbiW/ROfqhsZkN5ZzH2v3On8Zej+BMYuf2ci34='
WHERE
key_id = '7d214c91465977deffaab6d1f2b1b3b2b14b96efff13b3561657a265e5fe0fa1'
AND (
token = 'EITZ2rbiW/ROfqhsZkN5ZzH2v3On8Zej+BMYuf2ci34='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)