UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'djbtbA/lNkUgr2D7YWxiy7B70+0OuCR1bu6Cn7MXDbw='
WHERE
key_id = '00a71b1ea4de6d69c215cf091bc1d4898402898bfe9224e48e052361ff94c46b'
AND (
token = 'djbtbA/lNkUgr2D7YWxiy7B70+0OuCR1bu6Cn7MXDbw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)