UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '89eOz4Yr40Ini173JnwMt8VlkTWdtQeDlOmnzxKTCj8='
WHERE
key_id = 'dfa5fc99ee800bdcc3cf55f020b8a0c26fac0fbb8e5df9b45b6019d7d9ee5e83'
AND (
token = '89eOz4Yr40Ini173JnwMt8VlkTWdtQeDlOmnzxKTCj8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)