UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hVHKqHajIL/zHqzjqnuzIsVbUoIzqBJR+IksMp/KtYA='
WHERE
key_id = 'bc67973bf4545da04f4da89d39d9e5ae9e23c3edd3769697f5a5a9b4326b3e95'
AND (
token = 'hVHKqHajIL/zHqzjqnuzIsVbUoIzqBJR+IksMp/KtYA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)