UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ANSdvlkRnhVUSuCaeTjVNPrPsDPvcTsaXUBtOlfIbgw='
WHERE
key_id = '4653c0a9d1061ff547ee65510d5e7d6f069f54f7a10441b408978568989fd61c'
AND (
token = 'ANSdvlkRnhVUSuCaeTjVNPrPsDPvcTsaXUBtOlfIbgw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)