UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/ToLpRSZKWvI8M53cX6Jtwygm8hPeZGbt0UsxumXaCg='
WHERE
key_id = '7c953a9aae20ef8aa70da71b8b399efa6495a1a8ddde0f3d11ea7d7eddb1b221'
AND (
token = '/ToLpRSZKWvI8M53cX6Jtwygm8hPeZGbt0UsxumXaCg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)