UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RkzVN7N9Fit4LkrC5B0AW1boK8rNYXhNX2frWKplCxg='
WHERE
key_id = '283299a7afb7de586c28e0af8503acd7bf61a900bcc66092187baa10e3d830a2'
AND (
token = 'RkzVN7N9Fit4LkrC5B0AW1boK8rNYXhNX2frWKplCxg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)