UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0J5ezAAgBQP1hR108hUNcH+kLpVuhEyPTFLF5xMePQ0='
WHERE
key_id = '09327aaefa91e8f7d662ed0a6c20aa069ff9c6c76a11dce63ebaae1012222a61'
AND (
token = '0J5ezAAgBQP1hR108hUNcH+kLpVuhEyPTFLF5xMePQ0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)