UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ceUW0H17fU0sC7Pxx4LUFUQVUCiEaSIfxuDpT0Ueo4U='
WHERE
key_id = 'f7e6fcf02d10c6d1edd6ecb968f55ffbca96db2cb3b8a18336cff8f5a19fc7fd'
AND (
token = 'ceUW0H17fU0sC7Pxx4LUFUQVUCiEaSIfxuDpT0Ueo4U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)