UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1yaBwavCvI6MNFvP4oblyuPr7LzzsAuDrqrZCrLv8eY='
WHERE
key_id = 'ad1566ad795180c2f9b918c3959a5bf1fd47bdb4eec0cf30fee29f39c4292b22'
AND (
token = '1yaBwavCvI6MNFvP4oblyuPr7LzzsAuDrqrZCrLv8eY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)