UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GhEXdLLjWiJCoZRyayevmV9cTj9pKiQC5Lj04Mm7ydU='
WHERE
key_id = '50fa8ee9c964e04a91f3bfc0b8326cc7a8a8125715d6e68069ce2ae07194d0f2'
AND (
token = 'GhEXdLLjWiJCoZRyayevmV9cTj9pKiQC5Lj04Mm7ydU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)